/************************************************************************
                        CourseLectTimeSemeter.h.h - Copyright asaf
**************************************************************************/


#ifndef COURSELECTTIMESEMETER_H
#define COURSELECTTIMESEMETER_H
#include "../Shered/Object.h"
#include "Course.h"
#include "Person.h"
#include "AcademicTime.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;

/**
  * class CourseLectTimeSemeter
  * describes a lecture recored
  * connects a lecturer with a course and academic time to form 
  * a lecture that can be taken.
  * holds reference to Person(lecturer)/Course.
  * holds the number of students registered to the lecture
  * holds the maximum number of students which can register to the lecture
  * main key is person ID, course ID and academic time
  */

class CourseLectTimeSemeter : virtual public Object
{

public:
		// Constructors/Destructors
		// basic ctor
		// @param  &c course 
		// @param  &p lecturer
		// @param  &p maxatt maximum Attendants (student)
		CourseLectTimeSemeter (Course &c,Person &p,int maxatt);
		//copy ctor
		CourseLectTimeSemeter(const CourseLectTimeSemeter &rhs);
		//dtor
		virtual ~CourseLectTimeSemeter ( );
		//comparison operator with AcademicTime (time equles)
		bool operator==(const AcademicTime& rhs);
		//comparison operator (on key)
		bool operator==(const CourseLectTimeSemeter& rhs);
		//comparison operator with Course (on course ID key)
		bool operator==(const Course& rhs);
	
		//getters/setters
		Course & getCourseRef()const;
		Person & getLecturerRef()const;
		Course & getCourseRef();
		Person & getLecturerRef();
		string getCourseName();
		AcademicTime &getTime ( );
		int getMaxAtt()const;
		int getCurrentAtt()const;
		
		
		//checks if lecture is full
		bool isFull();

		//++ on num of Attendants for this lecture
		void addAttendant();
		//-- on num of Attendants for this lecture
		void subAttendant();
		//return the num of free palces for this lecture
		int freePlaces();
		
		
	

	

private:
	
		//time of the lecture
		AcademicTime m_time;
		//reference to the course of this lecture
		Course &m_CourseRef;
		//reference to the lecturer of this lecture
		Person &m_LecturerRef;
		//max students that can register to this lecture
		int maxAttendants;
		//current num of students registered to this lecture
		int currentAttendants;

		//default ctor (deprecated)
		CourseLectTimeSemeter ();
		//copy operator (deprecated)
		CourseLectTimeSemeter &operator=(const CourseLectTimeSemeter &rhs);
};

#endif // COURSELECTTIMESEMETER_H
